/*-----------------------------------------------------------------------------------------------------------------------------------------
File:			0 - MASTER DO FILE

Project:		Discrimination, Migration, and Economic Outcomes: Evidence from World War I (Ferrara & Fishback)	
Last change:	4/15/2022 (AF)
Version:		1.0

Purpose:		This file runs the entire project from start to finish.
-----------------------------------------------------------------------------------------------------------------------------------------*/

clear all
capture log close
capture set more off


*******************************************************************************************************************************************
// Admin
*******************************************************************************************************************************************

	// Set directory path
	foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"		///
				 "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"	///
				 "Z:/Dropbox/projects/WWI German Discrimination"				{
		
				global path "`i'"
				confirmdir "$path"
				if `r(confirmdir)'==0 continue, break
	}
	
	*log using "$path/Replication/replication.log", replace
	
*******************************************************************************************************************************************
// 1 - Data Handling
*******************************************************************************************************************************************

	* 1.A - Clean and geo-locate WWI casualty data
	do "$path/Replication/1.A - Clean WW1 Casualties.do"
	
	* 1.B - Clean the draft data
	do "$path/Replication/1.B - Clean WW1 Enlistment Data.do"
	
	* Generate the county level data
	do "$path/Replication/1.C - Generate county level data.do"
	
	* Generate the linked individual Census data
	do "$path/Replication/1.D - Generate linked individual samples.do"
	
	* Clean and prep the linked data to generate the estimation samples for the German and American workers
	do "$path/Replication/1.D.1 - Generate linked individual estimation samples - Germans.do"
	do "$path/Replication/1.D.2 - Generate linked individual estimation samples - Americans.do"


*******************************************************************************************************************************************
// Figures
*******************************************************************************************************************************************
	do "$path/Replication/2 - Generate figures.do"


*******************************************************************************************************************************************
// Tables
*******************************************************************************************************************************************
	do "$path/Replication/3 - Generate tables.do"
	
	*log close
